#include <bits/stdc++.h>
using namespace std;
int main()
{
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  int n,q;cin>>n>>q;
  vector<int> arr(n+1);
  vector<int> diff(n+1);
  for(int i=1;i<=n;++i)
  {
    cin>>arr[i];
  }
 for(int i=1;i<=n;++i)
 {
   diff[i]=arr[i]-arr[i-1];
 }
 while(q--)
 {
   int l,r,c;
   cin>>l>>r>>c;
   diff[l]+=c;
   diff[r+1]-=c;
 }
  for(int i=1;i<=n;++i)
  {
    arr[i]=arr[i-1]+diff[i];
    cout<<arr[i]<<" ";
  }
  return 0;
}
